{include file="public/header" /}
<style type="text/css">
	.aui-radio{width: 0.8rem;height: 0.8rem;vertical-align: middle;}
	.aui-list label{font-size: 0.5rem;display: -webkit-inline-box;display: table-cell;padding-right: 10px;}
	.aui-list .aui-list-item-input{padding-right: 4.75rem;margin-right: 10px;overflow: hidden;}
	.aui-list .aui-list-item-label{font-size: 14px;}
	.aui-list .aui-list-item-input,.aui-list .aui-list-item-input *{font-size: 14px;}
	.aui-list .aui-list-item:after{height: 1px !important;}
</style>

<div class="aui-content wrap Personal" style="padding: 10px 0.75rem;">
    <div class="innercontent1">
        <form method="post" action="" class="ajax-form" onSubmit="change_password();">
        	<ul class="aui-list aui-form-list">
        		<li class="aui-list-header">{$user['mobile'] ? '更换' : '绑定'}手机号</li>
        		{eq name="_is_set_password" value="1"}
					<li class="aui-list-item">
			            <div class="aui-list-item-inner">
			                <div class="aui-list-item-label" style="width: 70%;">
			                    登录密码
			                </div>
			                <div class="aui-list-item-input" style="padding:0;">
			                    <input name="password" type="password" placeholder="请输入登录密码！" data-label="登录密码" class="required form-control" value="">
			                </div>
			                <div class="aui-list-item-input" style="width: 5rem;">
			                    <label for="mobile" style="opacity: 0;display: block;padding: 0;width: 5rem;">发送验证码</label>
			                </div>
			            </div>
			        </li>
				{/eq}
				<li class="aui-list-item">
		            <div class="aui-list-item-inner">
		                <div class="aui-list-item-label" style="width: 70%;">
		                    手机号
		                </div>
		                <div class="aui-list-item-input" style="padding:0;">
		                    <input type="text" id="mobile" name="mobile"  class="required" placeholder="*手机号码" data-label="手机号" value="{$user['mobile']}">
		                </div>
		                <div class="aui-list-item-input" style="width: 5rem;">
		                    <label for="mobile" style="opacity: 0;display: block;padding: 0;width: 5rem;">发送验证码</label>
		                </div>
		            </div>
		        </li>
		        <li class="aui-list-item">
		            <div class="aui-list-item-inner">
		                <div class="aui-list-item-label" style="width: 70%;">
		                    图片验证码
		                </div>
		                <div class="aui-list-item-input" style="padding:0;">
		                    <input type="text" name="imgcode" placeholder="*图片验证码" class="required" value="" data-label="图片验证码">
		                </div>
		                
		                <div class="aui-list-item-input" style="width: 5rem;">
		                    <img class="img-verify" href="{:captcha_src()}" src="{:captcha_src()}" style="width: 105px;height: 40px;">
		                </div>
		            </div>
		        </li>
		        <li class="aui-list-item">
		            <div class="aui-list-item-inner">
		                <div class="aui-list-item-label" style="width: 70%;">
		                    验证码
		                </div>
		                <div class="aui-list-item-input" style="padding:0;">
		                    <input type="text" name="smscode" class="required" placeholder="*手机验证码" data-label="验证码" value="" >
		                </div>
		                <div class="aui-list-item-input" style="width: 5rem;">
		                    <button  class="get-smscode " autocomplete="off" sms-type="{$user['mobile'] ? 'change_mobile' : 'bind_mobile'}" url="{:url('get_smscode')}" type="button" style="font-size: 0.5rem;">发送验证码</button>
		                	<div class="smscode-time btn btn-primary" style="display: none"><span>60</span>s</div>
		                </div>
		            </div>
		        </li>
        	</ul>
            <div class="field submit-btn" style="padding: 0 10px;margin-top: 50px;">
                <button type="submit" class="aui-btn aui-btn-block aui-btn-sm aui-btn-danger">确认修改</button>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
function change_password(){
	$('input[type="password"]').each(function () {
		if(!$(this).hasClass('not-md5') && $(this).val()){
			var password     = $(this).val();
			var password_md5 = $.md5(password);
			$(this).val(password_md5);
		}
	});
}
</script>
{include file="public/footer" /}